<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>车辆管理</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" type="text/css" href="assets/layui/css/layui.css" media="all" />
		<link rel="stylesheet" type="text/css" href="assets/css/all.css"  />
	</head
	<body class="car-manage">
		<span class="layui-breadcrumb">
		    <a>询残系统</a>
			  <a><cite>车辆管理/状态</cite></a>
		</span>
		<div class="layui-fluid" style="padding:20px 0">
			<div class="layui-form">
				<div class="layui-form-item">
					<p class="layui-col-md6 " style="margin-right:10px;"><input id="key1" type="text" name="title" lay-verify="" placeholder="填写符合条件的搜索内容，例：车辆状态、车牌号、车牌、车型、报案号" autocomplete="off" class="layui-input"> </p>
					<div class="layui-inline">
						<div class="layui-input-inline">
							<select name="modules" lay-verify="" id="key2">
								<option value="">状态筛选</option>
								<option value="1">待审核</option>
								<option value="2">竞价中</option>
								<option value="3">已竞价</option>
								<option value="4">待提车</option>
								<option value="5">拍卖中</option>
								<option value="6">待过户</option>
							</select>
						</div>
					</div>
				</div>
				<div class="carTable">
					询价截止时间：
					<div class="layui-inline">
						<input type="text" name="date" id="date" lay-verify="date" placeholder="年-月-日" autocomplete="off" class="layui-input layui-date">
					</div>
					<button class="layui-btn" data-type="reload">搜索</button>
				</div>
			</div>
			<table class="layui-hide" id="car-type" lay-filter="carTypeTable"></table>
			<script type="text/html" id="checkInfor">
				<a class="layui-btn layui-btn-xs" lay-event="detail">编辑</a>
			</script>
		</div>
		<script src="assets/layui/layui.js" type="text/javascript"></script>
		<script src="assets/js/all.js" type="text/javascript"></script>
		<script type="text/javascript">
			layui.use(['table','layer','laypage'],function(){
				var table = layui.table,
					layer = layui.layer,
					laypage = layui.laypage,
					$ = layui.$
					
					//车辆管理状态页面js					
					//方法级渲染
					var tableIn = table.render({
						elem: '#car-type',
						url: 'assets/data/demo.json',
						cols: [
							[{
								field: 'id',
								title: '报案号',
								width: 80,
								//sort: true,
								//fixed: true
							}, {
								field: 'username',
								title: '车型',
								width: 80
							},{
								field: 'sign',
								title: '车牌'
							},{
								field: 'sex',
								title: '分公司'
							},{
								field: 'wealth',
								title: '车辆停放地'
							},{
								field: 'statu',
								title: '车辆状态'
							},{
								field: 'experience',
								title: '询价开始时间',
								minWidth: 110
							},{
								field: 'experience',
								title: '询价结束时间',
								minWidth: 110
							},{
								//fixed: 'right',
								align: 'center',
								toolbar: '#checkInfor'
							}]
						],
						page:true,
						limit: 10,
						limits:[10]
//						,done:function(res,curr,count){//res即为你接口返回的信息,curr 是当前页，count总页数
//							if(res.code == 0){
//								layer.msg(res.msg);
//							}
//							if(res.code == 1){
//								
//							}
//						}
					});

					$('.car-manage .carTable .layui-btn').on('click', function() {
						var key1 = $('#key1').val();	
						var key2 = $('#key2 option:selected').val();	
						var key3 = $('#date').val();	
							//执行重载
							tableIn.reload({
//								if(key1==''&key2==''&key3=''){
//									layer.msg("请输入搜索内容");
//									return;
//								}
								page: {
									curr: 1 //重新从第 1 页开始
								},
								where: {
									key1: key1,
									key2: key2,
									key3: key3									
								}
							});
					});
				
					//监听工具条
					table.on('tool(carTypeTable)', function(obj) {
						var data = obj.data;
						if(obj.event === 'detail') {
							//    layer.alert('编辑行：<br>'+ JSON.stringify(data))
//							var index = layer.open({
//								type: 2,
//								title: '车辆信息',
//								area: ['700px', '450px'],
//								fixed: false, //不固定
//								maxmin: true,
//								content: 'carDetailEditNew.html'
//							});
//							layer.full(index);
							window.location.href="carDetailEditNew.html";
						} 
//						else if(obj.event === 'del') {
//							layer.confirm('真的删除此行信息么', function(index) {
//								obj.del();
//								layer.close(index);
//							});
//						}
						//  else if(obj.event === 'edit'){
						//    layer.msg('ID：'+ data.id + ' 的查看操作');
						//  }
					});
	
			})
		</script>
	</body>

</html>